package org.dru.clay.resolver;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Set;

import org.dru.clay.respository.dependency.Dependency;

public class ConfigurationContext {
	private final Set<String> configurations;
	private final Dependency dependency;
	
	public static Collection<ConfigurationContext> create(Set<String> configurations, Collection<Dependency> dependencies) {
		final List<ConfigurationContext> list = new ArrayList<ConfigurationContext>(dependencies.size());
		for (Dependency dependency : dependencies) {
			list.add(new ConfigurationContext(dependency, configurations));
		}
		return list;
	}

	public ConfigurationContext(Dependency dependency, Set<String> configurations) {
		this.configurations = configurations;
		this.dependency = dependency;
	}

	public Set<String> getConfigurations() {
		return configurations;
	}

	public Dependency getDependency() {
		return dependency;
	}

	@Override
	public String toString() {
		return "ConfigurationContext [configurations=" + configurations + ", dependency=" + dependency + "]";
	}
}
 